package com.daye.homework.service;

import com.daye.homework.bean.Student;

import java.sql.SQLException;
import java.util.List;

/**
 * 管理员逻辑层
 */
public interface AdminService {
    /**
     * 管理员登录
     * @param username
     * @param password
     * @return
     */
    boolean adminLogin(String username, String password);

    /**
     * 添加学生
     * @param student
     */
    void addStudent(Student student) throws SQLException;

    /**
     * 遍历所有学生
     * @return
     */
    List<Student> getAllStudent() throws SQLException;

    /**
     * 根据id删除学生
     * @param id
     */
    void deleteStudentById(Integer id) throws SQLException;

    /**
     * 根据学号寻找学员
     * @param id
     * @return
     */
    Student getStudentById(int id) throws SQLException;

    /**
     * 根据id修改学员信息
     * @param student
     */
    void updateStudentById(Student student) throws SQLException;
}
